/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ar.com.neolokura.travian.helper.account.admin;

import ar.com.neolokura.travian.helper.troop.entity.TroopDetail;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author gustavo
 */
public class AccountParser {

    public AccountParser() {
    }

    public ArrayList<String> getVillageIds(String html) {
        
        ArrayList<String> villageLinks = new ArrayList<String>();
        //HARDCODE: villageLinks!
        Pattern pattern = Pattern.compile("(?<=href=\"\\?newdid=)[0-9]*(?=\")");
        Matcher matcher = pattern.matcher(html);

        while (matcher.find()) {
            if (!matcher.group().equals("")) {
                villageLinks.add(matcher.group());

            }
        }

        return villageLinks;
    }
    

}
